import pymongo

client = pymongo.MongoClient('47.104.31.138', 9099)
# print(client)
db = client.spider
# print(db)
# print(db.douban_movie)
# for data in db.douban_movie.find():
#     print(type(data))
#     print(data)
print(db.douban_movie.find_one({'rank': 9.7}))
result = db.douban_movie.insert_one({
    'title': '阿甘正传',
    'rank': 9.6,
    'motto': '生命就像一盒巧克力',
    'country': '美国',
    'duration': 165
})
print(result.inserted_id)
result = db.douban_movie.delete_many({})
print(result.deleted_count)
